home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 June: Reference Library / Dev.CD Jun 96 RL / Dev.CD Jun 96 RL.toast / Technical Documentation / develop / develop Issue 10 / develop Issue 10 code / Apple Event Objects.sea / Apple Event Objects / ObjectDispatch.c < prev    next >
MacBinary  |  1992-04-08  |  5.1 KB  |  [TEXT/KAHL]

open in: MacOS 8.1     |     Win98     |     DOS

browse contents    |     view JSON data     |     view as text


This file was processed as: MacBinary (archive/macBinary).

ConfidenceProgramDetectionMatch TypeSupport
66% dexvert Compact Compressed (Unix) (archive/compact) ext Supported
1% dexvert MacBinary (archive/macBinary) fallback Supported
1% dexvert Text File (text/txt) fallback Supported
100% file MacBinary II, inited, Wed Apr 8 17:59:09 1992, modified Wed Apr 8 17:59:09 1992, creator Think C, type ASCII, 4586 bytes "ObjectDispatch.c" , at 0x126a 428 bytes resource default (weak)
99% file data default
74% TrID Macintosh plain text (MacBinary) default
25% TrID MacBinary 2 default (weak)
100% dearkID deark: macbinary default
100% siegfried fmt/1762 MacBinary (II) default
100% lsar MacBinary default


id metadata
keyvalue
macFileType[TEXT]
macFileCreator[KAHL]



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 00 10 4f 62 6a 65 63 74 | 44 69 73 70 61 74 63 68 |..Object|Dispatch|
|00000010| 2e 63 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |.c......|........|
|00000020| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000030| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000040| 00 54 45 58 54 4b 41 48 | 4c 01 00 00 00 00 00 00 |.TEXTKAH|L.......|
|00000050| 00 00 00 00 00 11 ea 00 | 00 01 ac a6 09 1d 2d a6 |........|......-.|
|00000060| 09 1d 2d 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |..-.....|........|
|00000070| 00 00 00 00 00 00 00 00 | 00 00 81 81 96 86 00 00 |........|........|
|00000080| 2f 2a 20 20 46 69 6c 65 | 3a 20 4f 62 6a 65 63 74 |/* File|: Object|
|00000090| 44 69 73 70 61 74 63 68 | 2e 63 20 2a 2f 0d 0d 23 |Dispatch|.c */..#|
|000000a0| 69 6e 63 6c 75 64 65 20 | 22 41 45 4f 62 6a 65 63 |include |"AEObjec|
|000000b0| 74 73 2e 68 22 0d 23 69 | 6e 63 6c 75 64 65 20 22 |ts.h".#i|nclude "|
|000000c0| 41 45 52 65 67 69 73 74 | 72 79 2e 68 22 0d 23 69 |AERegist|ry.h".#i|
|000000d0| 6e 63 6c 75 64 65 20 22 | 53 63 72 69 70 74 53 63 |nclude "|ScriptSc|
|000000e0| 72 61 70 2e 68 22 0d 23 | 69 6e 63 6c 75 64 65 20 |rap.h".#|include |
|000000f0| 22 50 72 6f 74 6f 74 79 | 70 65 73 2e 68 22 0d 0d |"Prototy|pes.h"..|
|00000100| 0d 4f 53 45 72 72 20 53 | 65 6e 64 41 45 54 6f 4f |.OSErr S|endAEToO|
|00000110| 62 6a 65 63 74 20 28 09 | 63 6f 6e 73 74 20 41 70 |bject (.|const Ap|
|00000120| 70 6c 65 45 76 65 6e 74 | 20 2a 6d 65 73 73 61 67 |pleEvent| *messag|
|00000130| 65 2c 20 41 70 70 6c 65 | 45 76 65 6e 74 20 2a 72 |e, Apple|Event *r|
|00000140| 65 70 6c 79 2c 20 6c 6f | 6e 67 20 72 65 66 43 6f |eply, lo|ng refCo|
|00000150| 6e 2c 0d 09 09 09 09 09 | 09 09 09 41 45 45 76 65 |n,......|...AEEve|
|00000160| 6e 74 43 6c 61 73 73 20 | 63 6c 61 73 73 49 44 2c |ntClass |classID,|
|00000170| 20 41 45 45 76 65 6e 74 | 49 44 20 65 76 65 6e 74 | AEEvent|ID event|
|00000180| 49 44 2c 0d 09 09 09 09 | 09 09 09 09 44 65 73 63 |ID,.....|....Desc|
|00000190| 54 79 70 65 20 64 69 73 | 70 61 74 63 68 43 6c 61 |Type dis|patchCla|
|000001a0| 73 73 2c 20 63 6f 6e 73 | 74 20 41 45 44 65 73 63 |ss, cons|t AEDesc|
|000001b0| 20 2a 6f 73 70 65 63 2c | 20 63 6f 6e 73 74 20 41 | *ospec,| const A|
|000001c0| 45 44 65 73 63 20 2a 74 | 6f 6b 65 6e 29 0d 7b 0d |EDesc *t|oken).{.|
|000001d0| 09 4f 53 45 72 72 09 65 | 72 72 20 3d 20 6e 6f 45 |.OSErr.e|rr = noE|
|000001e0| 72 72 3b 0d 09 73 77 69 | 74 63 68 20 28 64 69 73 |rr;..swi|tch (dis|
|000001f0| 70 61 74 63 68 43 6c 61 | 73 73 29 20 7b 0d 09 09 |patchCla|ss) {...|
|00000200| 63 61 73 65 20 27 6e 75 | 6c 6c 27 3a 0d 09 09 63 |case 'nu|ll':...c|
|00000210| 61 73 65 20 63 41 70 70 | 6c 69 63 61 74 69 6f 6e |ase cApp|lication|
|00000220| 3a 0d 09 09 09 65 72 72 | 20 3d 20 41 70 70 5f 41 |:....err| = App_A|
|00000230| 45 5f 44 69 73 70 61 74 | 63 68 65 72 28 6d 65 73 |E_Dispat|cher(mes|
|00000240| 73 61 67 65 2c 20 72 65 | 70 6c 79 2c 20 72 65 66 |sage, re|ply, ref|
|00000250| 43 6f 6e 2c 20 63 6c 61 | 73 73 49 44 2c 20 65 76 |Con, cla|ssID, ev|
|00000260| 65 6e 74 49 44 2c 20 6f | 73 70 65 63 2c 20 74 6f |entID, o|spec, to|
|00000270| 6b 65 6e 29 3b 0d 09 09 | 62 72 65 61 6b 3b 0d 0d |ken);...|break;..|
|00000280| 09 09 63 61 73 65 20 63 | 57 69 6e 64 6f 77 3a 09 |..case c|Window:.|
|00000290| 09 2f 2a 20 57 65 27 6c | 6c 20 6c 65 74 20 74 68 |./* We'l|l let th|
|000002a0| 65 73 65 20 32 20 63 6c | 61 73 73 65 73 20 73 68 |ese 2 cl|asses sh|
|000002b0| 61 72 65 20 63 6f 6d 6d | 6f 6e 20 63 6f 64 65 2c |are comm|on code,|
|000002c0| 20 66 6f 72 20 6e 6f 77 | 20 2a 2f 0d 09 09 63 61 | for now| */...ca|
|000002d0| 73 65 20 63 44 6f 63 75 | 6d 65 6e 74 3a 0d 09 09 |se cDocu|ment:...|
|000002e0| 09 65 72 72 20 3d 20 57 | 69 6e 5f 41 45 5f 44 69 |.err = W|in_AE_Di|
|000002f0| 73 70 61 74 63 68 65 72 | 28 6d 65 73 73 61 67 65 |spatcher|(message|
|00000300| 2c 20 72 65 70 6c 79 2c | 20 72 65 66 43 6f 6e 2c |, reply,| refCon,|
|00000310| 20 63 6c 61 73 73 49 44 | 2c 20 65 76 65 6e 74 49 | classID|, eventI|
|00000320| 44 2c 20 6f 73 70 65 63 | 2c 20 74 6f 6b 65 6e 29 |D, ospec|, token)|
|00000330| 3b 0d 09 09 62 72 65 61 | 6b 3b 0d 0d 09 09 63 61 |;...brea|k;....ca|
|00000340| 73 65 20 63 45 6e 74 72 | 79 3a 0d 09 09 09 65 72 |se cEntr|y:....er|
|00000350| 72 20 3d 20 45 6e 74 72 | 79 5f 41 45 5f 44 69 73 |r = Entr|y_AE_Dis|
|00000360| 70 61 74 63 68 65 72 28 | 6d 65 73 73 61 67 65 2c |patcher(|message,|
|00000370| 20 72 65 70 6c 79 2c 20 | 72 65 66 43 6f 6e 2c 20 | reply, |refCon, |
|00000380| 63 6c 61 73 73 49 44 2c | 20 65 76 65 6e 74 49 44 |classID,| eventID|
|00000390| 2c 20 6f 73 70 65 63 2c | 20 74 6f 6b 65 6e 29 3b |, ospec,| token);|
|000003a0| 0d 09 09 62 72 65 61 6b | 3b 0d 09 09 0d 09 09 63 |...break|;......c|
|000003b0| 61 73 65 20 63 53 63 72 | 61 70 49 74 65 6d 3a 0d |ase cScr|apItem:.|
|000003c0| 09 09 09 65 72 72 20 3d | 20 49 74 65 6d 5f 41 45 |...err =| Item_AE|
|000003d0| 5f 44 69 73 70 61 74 63 | 68 65 72 28 6d 65 73 73 |_Dispatc|her(mess|
|000003e0| 61 67 65 2c 20 72 65 70 | 6c 79 2c 20 72 65 66 43 |age, rep|ly, refC|
|000003f0| 6f 6e 2c 20 63 6c 61 73 | 73 49 44 2c 20 65 76 65 |on, clas|sID, eve|
|00000400| 6e 74 49 44 2c 20 6f 73 | 70 65 63 2c 20 74 6f 6b |ntID, os|pec, tok|
|00000410| 65 6e 29 3b 0d 09 09 62 | 72 65 61 6b 3b 0d 09 09 |en);...b|reak;...|
|00000420| 0d 09 09 64 65 66 61 75 | 6c 74 3a 0d 09 09 09 65 |...defau|lt:....e|
|00000430| 72 72 20 3d 20 65 72 72 | 41 45 45 76 65 6e 74 4e |rr = err|AEEventN|
|00000440| 6f 74 48 61 6e 64 6c 65 | 64 3b 0d 09 7d 0d 09 72 |otHandle|d;..}..r|
|00000450| 65 74 75 72 6e 20 65 72 | 72 3b 0d 7d 20 2f 2a 20 |eturn er|r;.} /* |
|00000460| 53 65 6e 64 41 45 54 6f | 4f 62 6a 65 63 74 20 2a |SendAETo|Object *|
|00000470| 2f 0d 0d 0d 70 61 73 63 | 61 6c 20 4f 53 45 72 72 |/...pasc|al OSErr|
|00000480| 20 44 69 72 65 63 74 50 | 61 72 61 6d 44 69 73 70 | DirectP|aramDisp|
|00000490| 61 74 63 68 28 41 70 70 | 6c 65 45 76 65 6e 74 20 |atch(App|leEvent |
|000004a0| 2a 6d 65 73 73 61 67 65 | 2c 20 41 70 70 6c 65 45 |*message|, AppleE|
|000004b0| 76 65 6e 74 20 2a 72 65 | 70 6c 79 2c 20 6c 6f 6e |vent *re|ply, lon|
|000004c0| 67 20 72 65 66 63 6f 6e | 29 0d 7b 0d 09 4f 53 45 |g refcon|).{..OSE|
|000004d0| 72 72 09 09 09 65 72 72 | 09 3d 20 6e 6f 45 72 72 |rr...err|.= noErr|
|000004e0| 3b 0d 09 41 45 45 76 65 | 6e 74 43 6c 61 73 73 09 |;..AEEve|ntClass.|
|000004f0| 63 6c 61 73 73 49 44 3b | 0d 09 41 45 45 76 65 6e |classID;|..AEEven|
|00000500| 74 49 44 09 09 65 76 65 | 6e 74 49 44 3b 0d 09 4f |tID..eve|ntID;..O|
|00000510| 53 54 79 70 65 09 09 09 | 74 79 70 65 43 6f 64 65 |SType...|typeCode|
|00000520| 3b 0d 09 53 69 7a 65 09 | 09 09 61 63 74 75 61 6c |;..Size.|..actual|
|00000530| 53 69 7a 65 3b 0d 0d 09 | 41 45 44 65 73 63 09 09 |Size;...|AEDesc..|
|00000540| 09 6f 62 6a 65 63 74 53 | 70 65 63 3b 0d 09 44 65 |.objectS|pec;..De|
|00000550| 73 63 54 79 70 65 09 09 | 64 69 73 70 61 74 63 68 |scType..|dispatch|
|00000560| 43 6c 61 73 73 3b 0d 09 | 41 45 44 65 73 63 09 09 |Class;..|AEDesc..|
|00000570| 09 6e 75 6c 6c 44 65 73 | 63 20 09 09 3d 20 7b 27 |.nullDes|c ..= {'|
|00000580| 6e 75 6c 6c 27 2c 20 30 | 4c 7d 3b 0d 09 41 45 44 |null', 0|L};..AED|
|00000590| 65 73 63 09 09 09 72 65 | 73 6f 6c 76 65 64 54 6f |esc...re|solvedTo|
|000005a0| 6b 65 6e 09 3d 20 7b 27 | 6e 75 6c 6c 27 2c 20 30 |ken.= {'|null', 0|
|000005b0| 4c 7d 3b 0d 09 41 45 44 | 65 73 63 09 09 09 64 69 |L};..AED|esc...di|
|000005c0| 73 70 61 74 63 68 50 61 | 72 61 6d 3b 0d 0d 09 28 |spatchPa|ram;...(|
|000005d0| 76 6f 69 64 29 41 45 47 | 65 74 41 74 74 72 69 62 |void)AEG|etAttrib|
|000005e0| 75 74 65 50 74 72 28 6d | 65 73 73 61 67 65 2c 20 |utePtr(m|essage, |
|000005f0| 6b 65 79 45 76 65 6e 74 | 43 6c 61 73 73 41 74 74 |keyEvent|ClassAtt|
|00000600| 72 2c 20 74 79 70 65 54 | 79 70 65 2c 20 26 74 79 |r, typeT|ype, &ty|
|00000610| 70 65 43 6f 64 65 2c 20 | 28 50 74 72 29 26 63 6c |peCode, |(Ptr)&cl|
|00000620| 61 73 73 49 44 2c 20 73 | 69 7a 65 6f 66 28 63 6c |assID, s|izeof(cl|
|00000630| 61 73 73 49 44 29 2c 20 | 26 61 63 74 75 61 6c 53 |assID), |&actualS|
|00000640| 69 7a 65 29 3b 0d 09 28 | 76 6f 69 64 29 41 45 47 |ize);..(|void)AEG|
|00000650| 65 74 41 74 74 72 69 62 | 75 74 65 50 74 72 28 6d |etAttrib|utePtr(m|
|00000660| 65 73 73 61 67 65 2c 20 | 6b 65 79 45 76 65 6e 74 |essage, |keyEvent|
|00000670| 49 44 41 74 74 72 2c 20 | 74 79 70 65 54 79 70 65 |IDAttr, |typeType|
|00000680| 2c 20 26 74 79 70 65 43 | 6f 64 65 2c 20 28 50 74 |, &typeC|ode, (Pt|
|00000690| 72 29 26 65 76 65 6e 74 | 49 44 2c 20 20 20 20 73 |r)&event|ID, s|
|000006a0| 69 7a 65 6f 66 28 65 76 | 65 6e 74 49 44 29 2c 20 |izeof(ev|entID), |
|000006b0| 20 20 20 26 61 63 74 75 | 61 6c 53 69 7a 65 29 3b | &actu|alSize);|
|000006c0| 0d 0d 09 2f 2a 20 20 45 | 78 74 72 61 63 74 20 74 |.../* E|xtract t|
|000006d0| 68 65 20 64 69 72 65 63 | 74 20 70 61 72 61 6d 65 |he direc|t parame|
|000006e0| 74 65 72 2c 20 77 68 69 | 63 68 20 69 73 20 61 6e |ter, whi|ch is an|
|000006f0| 20 6f 62 6a 65 63 74 20 | 73 70 65 63 69 66 69 65 | object |specifie|
|00000700| 72 20 2a 2f 0d 09 65 72 | 72 20 3d 20 41 45 47 65 |r */..er|r = AEGe|
|00000710| 74 50 61 72 61 6d 44 65 | 73 63 28 6d 65 73 73 61 |tParamDe|sc(messa|
|00000720| 67 65 2c 20 6b 65 79 44 | 69 72 65 63 74 4f 62 6a |ge, keyD|irectObj|
|00000730| 65 63 74 2c 20 74 79 70 | 65 57 69 6c 64 43 61 72 |ect, typ|eWildCar|
|00000740| 64 2c 20 26 6f 62 6a 65 | 63 74 53 70 65 63 29 3b |d, &obje|ctSpec);|
|00000750| 0d 09 69 66 20 28 65 72 | 72 20 21 3d 20 6e 6f 45 |..if (er|r != noE|
|00000760| 72 72 29 20 72 65 74 75 | 72 6e 20 65 72 72 3b 0d |rr) retu|rn err;.|
|00000770| 09 69 66 20 28 6f 62 6a | 65 63 74 53 70 65 63 2e |.if (obj|ectSpec.|
|00000780| 64 65 73 63 72 69 70 74 | 6f 72 54 79 70 65 20 3d |descript|orType =|
|00000790| 3d 20 27 6e 75 6c 6c 27 | 29 0d 09 09 2f 2a 20 57 |= 'null'|).../* W|
|000007a0| 65 20 73 70 65 63 69 61 | 6c 20 63 61 73 65 20 74 |e specia|l case t|
|000007b0| 68 69 73 20 73 69 6e 63 | 65 20 41 45 52 65 73 6f |his sinc|e AEReso|
|000007c0| 6c 76 65 20 64 6f 65 73 | 20 6e 6f 74 20 6c 69 6b |lve does| not lik|
|000007d0| 65 20 61 20 6e 75 6c 6c | 20 41 45 44 65 73 63 20 |e a null| AEDesc |
|000007e0| 2a 2f 0d 09 09 65 72 72 | 20 3d 20 53 65 6e 64 41 |*/...err| = SendA|
|000007f0| 45 54 6f 4f 62 6a 65 63 | 74 28 6d 65 73 73 61 67 |EToObjec|t(messag|
|00000800| 65 2c 20 72 65 70 6c 79 | 2c 20 72 65 66 63 6f 6e |e, reply|, refcon|
|00000810| 2c 20 63 6c 61 73 73 49 | 44 2c 20 65 76 65 6e 74 |, classI|D, event|
|00000820| 49 44 2c 20 27 6e 75 6c | 6c 27 2c 20 26 6f 62 6a |ID, 'nul|l', &obj|
|00000830| 65 63 74 53 70 65 63 2c | 20 26 6e 75 6c 6c 44 65 |ectSpec,| &nullDe|
|00000840| 73 63 29 3b 0d 09 65 6c | 73 65 20 7b 0d 09 09 65 |sc);..el|se {...e|
|00000850| 72 72 20 3d 20 41 45 52 | 65 73 6f 6c 76 65 28 26 |rr = AER|esolve(&|
|00000860| 6f 62 6a 65 63 74 53 70 | 65 63 2c 20 6b 41 45 49 |objectSp|ec, kAEI|
|00000870| 44 6f 4d 69 6e 69 6d 75 | 6d 2c 20 26 72 65 73 6f |DoMinimu|m, &reso|
|00000880| 6c 76 65 64 54 6f 6b 65 | 6e 29 3b 0d 09 09 69 66 |lvedToke|n);...if|
|00000890| 20 28 65 72 72 20 21 3d | 20 6e 6f 45 72 72 29 20 | (err !=| noErr) |
|000008a0| 72 65 74 75 72 6e 20 65 | 72 72 3b 0d 09 09 65 72 |return e|rr;...er|
|000008b0| 72 20 3d 20 53 65 6e 64 | 41 45 54 6f 4f 62 6a 65 |r = Send|AEToObje|
|000008c0| 63 74 28 6d 65 73 73 61 | 67 65 2c 20 72 65 70 6c |ct(messa|ge, repl|
|000008d0| 79 2c 20 72 65 66 63 6f | 6e 2c 20 63 6c 61 73 73 |y, refco|n, class|
|000008e0| 49 44 2c 20 65 76 65 6e | 74 49 44 2c 20 74 6f 6b |ID, even|tID, tok|
|000008f0| 65 6e 44 69 73 70 61 74 | 63 68 43 6c 61 73 73 28 |enDispat|chClass(|
|00000900| 72 65 73 6f 6c 76 65 64 | 54 6f 6b 65 6e 29 2c 20 |resolved|Token), |
|00000910| 26 6f 62 6a 65 63 74 53 | 70 65 63 2c 20 26 72 65 |&objectS|pec, &re|
|00000920| 73 6f 6c 76 65 64 54 6f | 6b 65 6e 29 3b 0d 09 09 |solvedTo|ken);...|
|00000930| 28 76 6f 69 64 29 41 45 | 44 69 73 70 6f 73 65 44 |(void)AE|DisposeD|
|00000940| 65 73 63 28 26 72 65 73 | 6f 6c 76 65 64 54 6f 6b |esc(&res|olvedTok|
|00000950| 65 6e 29 3b 0d 09 09 28 | 76 6f 69 64 29 41 45 44 |en);...(|void)AED|
|00000960| 69 73 70 6f 73 65 44 65 | 73 63 28 26 6f 62 6a 65 |isposeDe|sc(&obje|
|00000970| 63 74 53 70 65 63 29 3b | 0d 09 7d 0d 0d 09 72 65 |ctSpec);|..}...re|
|00000980| 74 75 72 6e 20 65 72 72 | 3b 0d 7d 20 2f 2a 20 44 |turn err|;.} /* D|
|00000990| 69 72 65 63 74 50 61 72 | 61 6d 44 69 73 70 61 74 |irectPar|amDispat|
|000009a0| 63 68 20 2a 2f 0d 0d 0d | 70 61 73 63 61 6c 20 4f |ch */...|pascal O|
|000009b0| 53 45 72 72 20 43 72 65 | 61 74 65 45 6c 65 6d 65 |SErr Cre|ateEleme|
|000009c0| 6e 74 44 69 73 70 61 74 | 63 68 28 41 70 70 6c 65 |ntDispat|ch(Apple|
|000009d0| 45 76 65 6e 74 20 2a 6d | 65 73 73 61 67 65 2c 20 |Event *m|essage, |
|000009e0| 41 70 70 6c 65 45 76 65 | 6e 74 20 2a 72 65 70 6c |AppleEve|nt *repl|
|000009f0| 79 2c 20 6c 6f 6e 67 20 | 72 65 66 63 6f 6e 29 0d |y, long |refcon).|
|00000a00| 7b 0d 09 4f 53 45 72 72 | 09 09 09 65 72 72 09 3d |{..OSErr|...err.=|
|00000a10| 20 6e 6f 45 72 72 3b 0d | 09 41 45 45 76 65 6e 74 | noErr;.|.AEEvent|
|00000a20| 43 6c 61 73 73 09 63 6c | 61 73 73 49 44 3b 0d 09 |Class.cl|assID;..|
|00000a30| 41 45 45 76 65 6e 74 49 | 44 09 09 65 76 65 6e 74 |AEEventI|D..event|
|00000a40| 49 44 3b 0d 09 4f 53 54 | 79 70 65 09 09 09 74 79 |ID;..OST|ype...ty|
|00000a50| 70 65 43 6f 64 65 3b 0d | 09 53 69 7a 65 09 09 09 |peCode;.|.Size...|
|00000a60| 61 63 74 75 61 6c 53 69 | 7a 65 3b 0d 0d 09 41 45 |actualSi|ze;...AE|
|00000a70| 44 65 73 63 09 09 09 69 | 6e 73 65 72 74 69 6f 6e |Desc...i|nsertion|
|00000a80| 4c 6f 63 2c 0d 09 09 09 | 09 09 6f 62 6a 65 63 74 |Loc,....|..object|
|00000a90| 53 70 65 63 3b 0d 09 44 | 65 73 63 54 79 70 65 09 |Spec;..D|escType.|
|00000aa0| 09 64 69 73 70 61 74 63 | 68 43 6c 61 73 73 2c 0d |.dispatc|hClass,.|
|00000ab0| 09 09 09 09 09 69 6e 73 | 65 72 74 69 6f 6e 50 6f |.....ins|ertionPo|
|00000ac0| 73 3b 0d 09 41 45 44 65 | 73 63 09 09 09 72 65 73 |s;..AEDe|sc...res|
|00000ad0| 6f 6c 76 65 64 54 6f 6b | 65 6e 09 3d 20 7b 27 6e |olvedTok|en.= {'n|
|00000ae0| 75 6c 6c 27 2c 20 30 4c | 7d 3b 0d 0d 09 28 76 6f |ull', 0L|};...(vo|
|00000af0| 69 64 29 41 45 47 65 74 | 41 74 74 72 69 62 75 74 |id)AEGet|Attribut|
|00000b00| 65 50 74 72 28 6d 65 73 | 73 61 67 65 2c 20 6b 65 |ePtr(mes|sage, ke|
|00000b10| 79 45 76 65 6e 74 43 6c | 61 73 73 41 74 74 72 2c |yEventCl|assAttr,|
|00000b20| 20 74 79 70 65 54 79 70 | 65 2c 20 26 74 79 70 65 | typeTyp|e, &type|
|00000b30| 43 6f 64 65 2c 20 28 50 | 74 72 29 26 63 6c 61 73 |Code, (P|tr)&clas|
|00000b40| 73 49 44 2c 20 73 69 7a | 65 6f 66 28 63 6c 61 73 |sID, siz|eof(clas|
|00000b50| 73 49 44 29 2c 20 26 61 | 63 74 75 61 6c 53 69 7a |sID), &a|ctualSiz|
|00000b60| 65 29 3b 0d 09 28 76 6f | 69 64 29 41 45 47 65 74 |e);..(vo|id)AEGet|
|00000b70| 41 74 74 72 69 62 75 74 | 65 50 74 72 28 6d 65 73 |Attribut|ePtr(mes|
|00000b80| 73 61 67 65 2c 20 6b 65 | 79 45 76 65 6e 74 49 44 |sage, ke|yEventID|
|00000b90| 41 74 74 72 2c 20 74 79 | 70 65 54 79 70 65 2c 20 |Attr, ty|peType, |
|00000ba0| 26 74 79 70 65 43 6f 64 | 65 2c 20 28 50 74 72 29 |&typeCod|e, (Ptr)|
|00000bb0| 26 65 76 65 6e 74 49 44 | 2c 20 20 20 20 73 69 7a |&eventID|, siz|
|00000bc0| 65 6f 66 28 65 76 65 6e | 74 49 44 29 2c 20 20 20 |eof(even|tID), |
|00000bd0| 20 26 61 63 74 75 61 6c | 53 69 7a 65 29 3b 0d 0d | &actual|Size);..|
|00000be0| 09 2f 2a 20 57 65 27 72 | 65 20 73 70 65 63 69 61 |./* We'r|e specia|
|00000bf0| 6c 2d 63 61 73 69 6e 67 | 20 43 72 65 61 74 65 20 |l-casing| Create |
|00000c00| 45 6c 65 6d 65 6e 74 2c | 20 61 73 20 74 68 65 20 |Element,| as the |
|00000c10| 6f 62 6a 65 63 74 20 73 | 70 65 63 69 66 69 65 72 |object s|pecifier|
|00000c20| 20 69 73 20 63 6f 6e 74 | 61 69 6e 65 64 20 69 6e | is cont|ained in|
|00000c30| 20 20 2a 2f 0d 09 2f 2a | 20 61 20 54 79 70 65 49 | */../*| a TypeI|
|00000c40| 6e 73 65 72 74 69 6f 6e | 4c 6f 63 20 72 65 63 6f |nsertion|Loc reco|
|00000c50| 72 64 2e 20 57 65 27 6c | 6c 20 6c 65 74 20 74 68 |rd. We'l|l let th|
|00000c60| 65 20 41 70 70 6c 65 20 | 45 76 65 6e 74 20 4d 61 |e Apple |Event Ma|
|00000c70| 6e 61 67 65 72 20 63 6f | 65 72 63 65 20 74 68 65 |nager co|erce the|
|00000c80| 20 09 09 20 2a 2f 0d 09 | 2f 2a 20 69 6e 73 65 72 | .. */..|/* inser|
|00000c90| 74 69 6f 6e 4c 6f 63 20 | 72 65 63 6f 72 64 20 69 |tionLoc |record i|
|00000ca0| 6e 74 6f 20 61 6e 20 41 | 45 52 65 63 6f 72 64 20 |nto an A|ERecord |
|00000cb0| 73 6f 20 77 65 20 63 61 | 6e 20 65 78 74 72 61 63 |so we ca|n extrac|
|00000cc0| 74 20 74 68 65 20 66 69 | 65 6c 64 73 2e 20 09 09 |t the fi|elds. ..|
|00000cd0| 09 20 2a 2f 0d 0d 09 65 | 72 72 20 3d 20 41 45 47 |. */...e|rr = AEG|
|00000ce0| 65 74 50 61 72 61 6d 44 | 65 73 63 28 6d 65 73 73 |etParamD|esc(mess|
|00000cf0| 61 67 65 2c 20 6b 65 79 | 41 45 49 6e 73 65 72 74 |age, key|AEInsert|
|00000d00| 48 65 72 65 2c 20 74 79 | 70 65 41 45 52 65 63 6f |Here, ty|peAEReco|
|00000d10| 72 64 2c 20 26 69 6e 73 | 65 72 74 69 6f 6e 4c 6f |rd, &ins|ertionLo|
|00000d20| 63 29 3b 0d 09 69 66 20 | 28 65 72 72 20 21 3d 20 |c);..if |(err != |
|00000d30| 6e 6f 45 72 72 29 20 20 | 72 65 74 75 72 6e 20 65 |noErr) |return e|
|00000d40| 72 72 3b 0d 0d 09 2f 2a | 20 57 65 27 76 65 20 64 |rr;.../*| We've d|
|00000d50| 65 63 69 64 65 64 20 74 | 68 61 74 20 65 61 63 68 |ecided t|hat each|
|00000d60| 20 6f 62 6a 65 63 74 20 | 73 68 6f 75 6c 64 20 62 | object |should b|
|00000d70| 65 20 72 65 73 70 6f 6e | 73 69 62 6c 65 20 66 6f |e respon|sible fo|
|00000d80| 72 20 69 74 73 20 6f 77 | 6e 20 63 72 65 61 74 69 |r its ow|n creati|
|00000d90| 6f 6e 2c 20 73 6f 20 2a | 2f 0d 09 2f 2a 20 77 65 |on, so *|/../* we|
|00000da0| 27 6c 6c 20 70 61 73 73 | 20 74 68 65 20 72 65 73 |'ll pass| the res|
|00000db0| 6f 6c 76 65 64 20 74 6f | 6b 65 6e 20 74 6f 20 74 |olved to|ken to t|
|00000dc0| 68 65 20 63 6c 61 73 73 | 20 73 70 65 63 69 66 69 |he class| specifi|
|00000dd0| 65 64 20 69 6e 20 22 6b | 65 79 41 45 4f 62 6a 65 |ed in "k|eyAEObje|
|00000de0| 63 74 43 6c 61 73 73 22 | 09 20 2a 2f 0d 09 65 72 |ctClass"|. */..er|
|00000df0| 72 20 3d 20 41 45 47 65 | 74 50 61 72 61 6d 50 74 |r = AEGe|tParamPt|
|00000e00| 72 28 6d 65 73 73 61 67 | 65 2c 20 6b 65 79 41 45 |r(messag|e, keyAE|
|00000e10| 4f 62 6a 65 63 74 43 6c | 61 73 73 2c 20 74 79 70 |ObjectCl|ass, typ|
|00000e20| 65 54 79 70 65 2c 20 26 | 74 79 70 65 43 6f 64 65 |eType, &|typeCode|
|00000e30| 2c 0d 09 09 09 09 09 09 | 28 50 74 72 29 26 64 69 |,.......|(Ptr)&di|
|00000e40| 73 70 61 74 63 68 43 6c | 61 73 73 2c 20 73 69 7a |spatchCl|ass, siz|
|00000e50| 65 6f 66 28 64 69 73 70 | 61 74 63 68 43 6c 61 73 |eof(disp|atchClas|
|00000e60| 73 29 2c 20 26 61 63 74 | 75 61 6c 53 69 7a 65 29 |s), &act|ualSize)|
|00000e70| 3b 0d 09 69 66 20 28 65 | 72 72 20 21 3d 20 6e 6f |;..if (e|rr != no|
|00000e80| 45 72 72 29 20 20 72 65 | 74 75 72 6e 20 65 72 72 |Err) re|turn err|
|00000e90| 3b 0d 0d 09 2f 2a 20 53 | 69 6e 63 65 20 77 65 27 |;.../* S|ince we'|
|00000ea0| 72 65 20 6e 6f 74 20 75 | 73 69 6e 67 20 74 68 65 |re not u|sing the|
|00000eb0| 20 72 65 66 63 6f 6e 20 | 66 6f 72 20 61 6e 79 74 | refcon |for anyt|
|00000ec0| 68 69 6e 67 2c 20 77 65 | 27 6c 6c 20 67 65 74 20 |hing, we|'ll get |
|00000ed0| 74 68 65 20 69 6e 73 65 | 72 74 69 6f 6e 20 70 6f |the inse|rtion po|
|00000ee0| 73 69 74 69 6f 6e 20 2a | 2f 0d 09 2f 2a 20 61 6e |sition *|/../* an|
|00000ef0| 64 20 70 61 73 73 20 69 | 74 20 61 6c 6f 6e 67 20 |d pass i|t along |
|00000f00| 69 6e 20 72 65 66 43 6f | 6e 20 2a 2f 0d 09 28 76 |in refCo|n */..(v|
|00000f10| 6f 69 64 29 20 41 45 47 | 65 74 4b 65 79 50 74 72 |oid) AEG|etKeyPtr|
|00000f20| 28 26 69 6e 73 65 72 74 | 69 6f 6e 4c 6f 63 2c 20 |(&insert|ionLoc, |
|00000f30| 6b 65 79 41 45 50 6f 73 | 69 74 69 6f 6e 2c 20 74 |keyAEPos|ition, t|
|00000f40| 79 70 65 45 6e 75 6d 65 | 72 61 74 69 6f 6e 2c 20 |ypeEnume|ration, |
|00000f50| 26 74 79 70 65 43 6f 64 | 65 2c 20 28 50 74 72 29 |&typeCod|e, (Ptr)|
|00000f60| 26 69 6e 73 65 72 74 69 | 6f 6e 50 6f 73 2c 0d 09 |&inserti|onPos,..|
|00000f70| 09 09 09 20 20 20 09 09 | 73 69 7a 65 6f 66 28 69 |... ..|sizeof(i|
|00000f80| 6e 73 65 72 74 69 6f 6e | 50 6f 73 29 2c 20 26 61 |nsertion|Pos), &a|
|00000f90| 63 74 75 61 6c 53 69 7a | 65 29 3b 0d 0d 09 2f 2a |ctualSiz|e);.../*|
|00000fa0| 20 41 6e 64 2c 20 6a 75 | 73 74 20 74 6f 20 73 61 | And, ju|st to sa|
|00000fb0| 76 65 20 73 6f 6d 65 20 | 64 75 70 6c 69 63 61 74 |ve some |duplicat|
|00000fc0| 65 20 63 6f 64 65 2c 20 | 77 65 27 6c 6c 20 65 78 |e code, |we'll ex|
|00000fd0| 74 72 61 63 74 20 61 6e | 64 20 72 65 73 6f 6c 76 |tract an|d resolv|
|00000fe0| 65 20 74 68 65 20 6f 62 | 6a 65 63 74 20 09 20 2a |e the ob|ject . *|
|00000ff0| 2f 0d 09 2f 2a 20 73 70 | 65 63 69 66 69 65 72 20 |/../* sp|ecifier |
|00001000| 68 65 72 65 20 62 65 66 | 6f 72 65 20 63 61 6c 6c |here bef|ore call|
|00001010| 69 6e 67 20 74 68 65 20 | 61 63 74 75 61 6c 20 22 |ing the |actual "|
|00001020| 43 72 65 61 74 65 20 45 | 6c 65 6d 65 6e 74 22 20 |Create E|lement" |
|00001030| 72 6f 75 74 69 6e 65 2e | 09 09 09 20 2a 2f 0d 09 |routine.|... */..|
|00001040| 65 72 72 20 3d 20 41 45 | 47 65 74 4b 65 79 44 65 |err = AE|GetKeyDe|
|00001050| 73 63 28 26 69 6e 73 65 | 72 74 69 6f 6e 4c 6f 63 |sc(&inse|rtionLoc|
|00001060| 2c 20 6b 65 79 41 45 4f | 62 6a 65 63 74 2c 20 74 |, keyAEO|bject, t|
|00001070| 79 70 65 57 69 6c 64 43 | 61 72 64 2c 20 26 6f 62 |ypeWildC|ard, &ob|
|00001080| 6a 65 63 74 53 70 65 63 | 29 3b 0d 09 69 66 20 28 |jectSpec|);..if (|
|00001090| 6f 62 6a 65 63 74 53 70 | 65 63 2e 64 65 73 63 72 |objectSp|ec.descr|
|000010a0| 69 70 74 6f 72 54 79 70 | 65 20 21 3d 20 27 6e 75 |iptorTyp|e != 'nu|
|000010b0| 6c 6c 27 29 20 7b 0d 09 | 09 65 72 72 20 3d 20 41 |ll') {..|.err = A|
|000010c0| 45 52 65 73 6f 6c 76 65 | 28 26 6f 62 6a 65 63 74 |EResolve|(&object|
|000010d0| 53 70 65 63 2c 20 6b 41 | 45 49 44 6f 4d 69 6e 69 |Spec, kA|EIDoMini|
|000010e0| 6d 75 6d 2c 20 26 72 65 | 73 6f 6c 76 65 64 54 6f |mum, &re|solvedTo|
|000010f0| 6b 65 6e 29 3b 0d 09 09 | 69 66 20 28 65 72 72 20 |ken);...|if (err |
|00001100| 21 3d 20 6e 6f 45 72 72 | 29 20 72 65 74 75 72 6e |!= noErr|) return|
|00001110| 20 65 72 72 3b 0d 09 7d | 0d 09 65 72 72 20 3d 20 | err;..}|..err = |
|00001120| 53 65 6e 64 41 45 54 6f | 4f 62 6a 65 63 74 28 6d |SendAETo|Object(m|
|00001130| 65 73 73 61 67 65 2c 20 | 72 65 70 6c 79 2c 20 28 |essage, |reply, (|
|00001140| 6c 6f 6e 67 29 69 6e 73 | 65 72 74 69 6f 6e 50 6f |long)ins|ertionPo|
|00001150| 73 2c 20 2f 2a 20 77 61 | 73 3a 20 72 65 66 63 6f |s, /* wa|s: refco|
|00001160| 6e 20 2a 2f 0d 09 09 09 | 09 09 09 09 20 63 6c 61 |n */....|.... cla|
|00001170| 73 73 49 44 2c 20 65 76 | 65 6e 74 49 44 2c 20 64 |ssID, ev|entID, d|
|00001180| 69 73 70 61 74 63 68 43 | 6c 61 73 73 2c 20 26 6f |ispatchC|lass, &o|
|00001190| 62 6a 65 63 74 53 70 65 | 63 2c 20 26 72 65 73 6f |bjectSpe|c, &reso|
|000011a0| 6c 76 65 64 54 6f 6b 65 | 6e 29 3b 0d 0d 09 28 76 |lvedToke|n);...(v|
|000011b0| 6f 69 64 29 41 45 44 69 | 73 70 6f 73 65 44 65 73 |oid)AEDi|sposeDes|
|000011c0| 63 28 26 69 6e 73 65 72 | 74 69 6f 6e 4c 6f 63 29 |c(&inser|tionLoc)|
|000011d0| 3b 0d 09 28 76 6f 69 64 | 29 41 45 44 69 73 70 6f |;..(void|)AEDispo|
|000011e0| 73 65 44 65 73 63 28 26 | 72 65 73 6f 6c 76 65 64 |seDesc(&|resolved|
|000011f0| 54 6f 6b 65 6e 29 3b 0d | 09 69 66 20 28 6f 62 6a |Token);.|.if (obj|
|00001200| 65 63 74 53 70 65 63 2e | 64 61 74 61 48 61 6e 64 |ectSpec.|dataHand|
|00001210| 6c 65 20 21 3d 20 4e 55 | 4c 4c 29 0d 09 28 76 6f |le != NU|LL)..(vo|
|00001220| 69 64 29 41 45 44 69 73 | 70 6f 73 65 44 65 73 63 |id)AEDis|poseDesc|
|00001230| 28 26 6f 62 6a 65 63 74 | 53 70 65 63 29 3b 0d 09 |(&object|Spec);..|
|00001240| 72 65 74 75 72 6e 20 65 | 72 72 3b 0d 7d 20 2f 2a |return e|rr;.} /*|
|00001250| 20 43 72 65 61 74 65 45 | 6c 65 6d 65 6e 74 44 69 | CreateE|lementDi|
|00001260| 73 70 61 74 63 68 20 2a | 2f 0d 00 00 00 00 00 00 |spatch *|/.......|
|00001270| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001280| 00 00 01 00 00 00 01 66 | 00 00 00 66 00 00 00 46 |.......f|...f...F|
|00001290| 00 00 70 c9 00 44 03 00 | 00 00 00 00 00 00 00 00 |..p..D..|........|
|000012a0| 00 00 06 af 0a 44 65 73 | 6b 74 6f 70 70 65 72 00 |.....Des|ktopper.|
|000012b0| 10 4f 62 6a 65 63 74 44 | 69 73 70 61 74 63 68 2e |.ObjectD|ispatch.|
|000012c0| 63 6a 02 00 00 00 54 45 | 58 54 4b 41 48 4c 01 00 |cj....TE|XTKAHL..|
|000012d0| 00 00 54 45 58 54 4b 41 | 48 4c 01 00 00 96 00 09 |..TEXTKA|HL......|
|000012e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000012f0| 00 00 a5 e1 91 f0 00 00 | 11 ea 00 00 01 ac a5 bf |........|........|
|00001300| 66 bd a5 c2 a3 3d 00 00 | 00 00 00 00 00 00 00 00 |f....=..|........|
|00001310| 00 00 00 00 00 00 00 00 | 00 00 00 00 be db 00 01 |........|........|
|00001320| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001330| 00 00 00 00 00 00 00 00 | 1a 00 00 00 70 c9 14 41 |........|....p..A|
|00001340| 70 70 6c 65 45 76 65 6e | 74 48 61 6e 64 6c 65 72 |ppleEven|tHandler|
|00001350| 73 2e 63 76 02 00 00 00 | 54 45 58 54 4b 41 48 4c |s.cv....|TEXTKAHL|
|00001360| 01 00 00 00 00 00 00 00 | 00 00 70 ca 00 00 00 00 |........|..p.....|
|00001370| 1d 19 00 00 1e 00 00 00 | 00 00 01 e6 00 00 0a 00 |........|........|
|00001380| 00 00 00 54 00 03 00 00 | 09 35 00 00 09 4a 15 43 |...T....|.5...J.C|
|00001390| 72 65 61 74 65 45 6c 65 | 6d 65 6e 74 44 69 73 70 |reateEle|mentDisp|
|000013a0| 61 74 63 68 00 00 04 01 | 00 00 04 14 13 44 69 72 |atch....|.....Dir|
|000013b0| 65 63 74 50 61 72 61 6d | 44 69 73 70 61 74 63 68 |ectParam|Dispatch|
|000013c0| 00 00 00 87 00 00 00 95 | 0f 53 65 6e 64 41 45 54 |........|.SendAET|
|000013d0| 6f 4f 62 6a 65 63 74 00 | 00 00 00 0a 00 00 0a 6c |oObject.|.......l|
|000013e0| 00 58 00 00 00 00 00 00 | 01 00 00 00 01 66 00 00 |.X......|.....f..|
|000013f0| 00 66 00 00 00 46 01 06 | f5 00 06 fc 00 00 00 1c |.f...F..|........|
|00001400| 00 46 00 01 4d 50 53 52 | 00 00 00 12 42 4b 50 54 |.F..MPSR|....BKPT|
|00001410| 00 00 00 1e 03 ef ff ff | 00 00 00 00 00 00 00 00 |........|........|
|00001420| 2a a4 ff ff 00 00 00 58 | 00 00 00 00 00 00 00 00 |*......X|........|
|00001430| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001440| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001450| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001460| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001470| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
+--------+-------------------------+-------------------------+--------+--------+